package common;

/**
 * 响应状态的枚举
 * Created by Hisen on 2017/11/4.
 */
public enum ResponseCode {
  SUCCESS(1, "SUCCESS"),
  ERROR(0, "ERROR"),
  NEED_LOGIN(10, "NEED_LOGIN"),
  PERMISSION_DENIED(20, "PERMISSION_DENIED"),
  ILLEGAL_ARGUMENT(2, "ILLEGAL_ARGUMENT"),
  NO_LIST_DATA(30, "NO_LIST_DATA"),
  SERVER_ERROR(40, "The server is abnormal. Please try again or contact the administrator");

  private final int code;
  private final String desc;

  ResponseCode(int code, String desc){
    this.code = code;
    this.desc = desc;
  }

  public int getCode() {
    return code;
  }

  public String getDesc() {
    return desc;
  }
}
